package com.asset.dispoal.business.casedispose;

import com.asset.dispoal.business.casedispose.api.CaseDisposeService;
import com.asset.dispoal.business.casedispose.dto.AppointAssetBatchResponse;
import com.asset.dispoal.business.casedispose.dto.CaseDisposalFileResponse;
import com.asset.dispoal.business.casedispose.dto.CaseDisposeExecutionUpdateRequest;
import com.asset.dispoal.business.casedispose.dto.CaseDisposeFormulaRequest;
import com.asset.dispoal.business.casedispose.dto.CaseDisposeFormulaResponse;
import com.asset.dispoal.business.casedispose.dto.CaseDisposeJudgmentUpdateRequest;
import com.asset.dispoal.business.casedispose.dto.CaseDisposeMediationUpdateRequest;
import com.asset.dispoal.business.casedispose.dto.CaseDisposeNormalUpdateRequest;
import com.asset.dispoal.business.casedispose.dto.CaseDisposePageRequest;
import com.asset.dispoal.business.casedispose.dto.CaseDisposePageResponse;
import com.asset.dispoal.business.casedispose.dto.CaseDisposePreLitigationMediationRequest;
import com.asset.dispoal.business.casedispose.dto.CaseDisposeRegisterUpdateRequest;
import com.asset.dispoal.business.casedispose.dto.CaseDisposeResponse;
import com.asset.dispoal.business.casedispose.dto.CaseDisposeWithdrawCaseRequest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import tech.mhuang.pacebox.springboot.protocol.Result;
import tech.mhuang.pacebox.springboot.protocol.data.PageVO;

import java.util.List;

@RestController
@RequestMapping("business/casedispose")
@Api(value = "案件处置管理", tags = "案件处置管理")
public class CaseDisposeController {

    @Autowired
    private CaseDisposeService caseDisposeService;

    @GetMapping("/queryPage")
    @ApiOperation(value = "案件处置分页查询", notes = "案件处置分页查询")
    public Result<PageVO<CaseDisposePageResponse>> queryPage(CaseDisposePageRequest request) {
        return caseDisposeService.queryPage(request);
    }

    @GetMapping("/getDetailById")
    @ApiOperation(value = "单个获取案件信息", notes = "单个获取案件信息")
    public Result<CaseDisposeResponse> getDetailById(String caseId) {
        return caseDisposeService.getDetailById(caseId);
    }


    @GetMapping("/queryDetailFileById")
    @ApiOperation(value = "获取单个案件的文件信息", notes = "获取单个案件的文件信息")
    public Result<List<CaseDisposalFileResponse>> queryDetailFileById(String caseId) {
        return caseDisposeService.queryDetailFileById(caseId);
    }

    @DeleteMapping("/deleteFileById")
    @ApiOperation(value = "删除案件处置的文件根据文件id", notes = "删除案件处置的文件根据文件id")
    public Result deleteFileById(String id) {
        return caseDisposeService.deleteFileById(id);
    }

    @GetMapping("/getFormulaByRequest")
    @ApiOperation(value = "公式检测计算", notes = "公式检测计算")
    public Result<CaseDisposeFormulaResponse> getFormulaByRequest(CaseDisposeFormulaRequest request) {
        return caseDisposeService.getFormulaByRequest(request);
    }

    @PutMapping("/preLitigationMediation")
    @ApiOperation(value = "诉前调解", notes = "诉前调解")
    public Result preLitigationMediation(@RequestBody CaseDisposePreLitigationMediationRequest request) {
        return caseDisposeService.preLitigationMediation(request);
    }

    @PutMapping("/withdrawCase")
    @ApiOperation(value = "撤案/撤诉", notes = "撤案/撤诉")
    public Result withdrawCase(@RequestBody CaseDisposeWithdrawCaseRequest request) {
        return caseDisposeService.withdrawCase(request);
    }

    @PutMapping("/updateNormal")
    @ApiOperation(value = "基本信息修改", notes = "基本信息修改")
    public Result updateNormal(@RequestBody CaseDisposeNormalUpdateRequest request) {
        return caseDisposeService.updateNormal(request);
    }

    @PutMapping("/updateRegister")
    @ApiOperation(value = "立案修改", notes = "立案修改")
    public Result updateRegister(@RequestBody CaseDisposeRegisterUpdateRequest request) {
        return caseDisposeService.updateRegister(request);
    }

    @PutMapping("/updateJudgment")
    @ApiOperation(value = "判决修改", notes = "判决修改")
    public Result updateJudgment(@RequestBody CaseDisposeJudgmentUpdateRequest request) {
        return caseDisposeService.updateJudgment(request);
    }

    @PutMapping("/updateMediation")
    @ApiOperation(value = "调解修改", notes = "调解修改")
    public Result updateMediation(@RequestBody CaseDisposeMediationUpdateRequest request) {
        return caseDisposeService.updateMediation(request);
    }

    @PutMapping("/updateExecution")
    @ApiOperation(value = "执行修改", notes = "执行修改")
    public Result updateExecution(@RequestBody CaseDisposeExecutionUpdateRequest request) {
        return caseDisposeService.updateExecution(request);
    }

    @GetMapping("/queryAppointList")
    public Result<List<AppointAssetBatchResponse>> queryAppointList() {
        return caseDisposeService.queryAppointList();
    }
}